﻿using System;
using System.Xml.Serialization;
using System.ComponentModel;

namespace SimpleMediaManager.TMDB
{
    public class MovieSearchCompletedEventArgs : AsyncCompletedEventArgs
    {
        private Movie[] movies;

        public Movie[] Movies
        {
            get
            {
                RaiseExceptionIfNecessary();
                return movies;
            }
        }

        public MovieSearchCompletedEventArgs(Movie[] movies, Exception e, bool canceled, object state)
            : base(e, canceled, state)
        {
            this.movies = movies;
        }
    }

    public class MovieInfoCompletedEventArgs : AsyncCompletedEventArgs
    {
        private Movie movie;

        public Movie Movie
        {
            get
            {
                RaiseExceptionIfNecessary();
                return movie;
            }
        }

        public MovieInfoCompletedEventArgs(Movie movie, Exception e, bool canceled, object state)
            : base(e, canceled, state)
        {
            this.movie = movie;
        }
    }

    public class PersonSearchCompletedEventArgs : AsyncCompletedEventArgs
    {
        private Person[] people;

        public Person[] People
        {
            get
            {
                RaiseExceptionIfNecessary();
                return people;
            }
        }

        public PersonSearchCompletedEventArgs(Person[] people, Exception e, bool canceled, object state)
            : base(e, canceled, state)
        {
            this.people = people;
        }
    }

    public class PersonInfoCompletedEventArgs : AsyncCompletedEventArgs
    {
        private Person person;

        public Person Person
        {
            get
            {
                RaiseExceptionIfNecessary();
                return person;
            }
        }

        public PersonInfoCompletedEventArgs(Person person, Exception e, bool canceled, object state)
            : base(e, canceled, state)
        {
            this.person = person;
        }
    }
}
